﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class JsCode : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["file"] != null)
        {

            Response.Clear();
            string sFileName = Request.QueryString["file"].ToString();

            switch (sFileName)
            {
                case "loginstatue"://更新状态
                    jsWrite(getLoinCode());
                    break;
                case "lastupdate":
                    if (Request.QueryString["lb"] != null)
                        WebMake.buildLastUpdatePage(Request.QueryString["lb"].ToString());
                    break;
                case "index":
                    WebMake.buildIndexPage();
                    break;
                case "topview":
                    if (Request.QueryString["lb"] != null)
                        WebMake.buildTopViewPage(Request.QueryString["lb"].ToString());
                    break;
                case "bookpage":
                    if(Request.QueryString["bookid"] != null)
                        WebMake.buildBookPage(Request.QueryString["bookid"].ToString(),0);
                    break;
                default: break;
                
            }
            Response.End();
        }

    }
    private  string getLoinCode()
    {
        return WebMake.getUserState(Page.User.Identity.Name);
    }
    private void jsWrite(string sContent)
    {
        Response.Write("document.write(\""+sContent+"\")");
    }
}
